﻿@model kxcxw.Data.Entities.Activity
@using kxcxw.Data.Common
@{
    ViewBag.Title = "填写促销信息";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/datepicker/WdatePicker.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/HtmlEdit/xheditor-1.1.12-zh-cn.min.js")" type="text/javascript"></script>
<div class="page_content">
    <h2>
        @ViewBag.ShopType - 填写促销活动信息</h2>
    <div class="flow_step_no1">
        <!-- s -->
        <div class="flow_step">
            <ol class="cols5">
                <li class="step_1 finish">
                    <div>
                        <i>1</i>
                        @Html.ActionLink("选择类型", "SelectType", "Home")
                        <span></span>
                    </div>
                </li>
                <li class="step_3 current">
                    <div>
                        <i>3</i>填写信息<span></span></div>
                </li>
            </ol>
        </div>
        <!-- e -->
    </div>
    @using (Html.BeginForm("Create", "Activity", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
        @Html.ValidationSummary(true)
        <fieldset>
            @Html.HiddenFor(model => model.ActivityId)
            @Html.HiddenFor(model => model.ShopType)
            @Html.HiddenFor(model => model.UserID)
            @Html.HiddenFor(model => model.Status)
            <div class="fromcontent">
                <div class="wholetip clear">
                    <h3>
                        @(ViewBag.ShopType)促销活动信息</h3>
                </div>
                <div class="field">
                    <div class="editor-label">
                        <span>*</span>标 题：</div>
                    <div class="editor-field-long">
                        @Html.EditorFor(model => model.Title)
                    </div>
                    <div class="editor-field-validate">
                        @Html.ValidationMessageFor(model => model.Title)
                    </div>
                </div>
                @if (ViewBag.ShopType == "实体店")
                {
                    <div class="field">
                        <div class="editor-label">
                            <span>*</span>详细地址：
                        </div>
                        <div class="editor-field-long">
                            @Html.EditorFor(model => model.Address)
                            @Html.Hidden("ShopUrl", "无")
                        </div>
                        <div class="editor-field-validate">
                            @Html.ValidationMessageFor(model => model.Address)
                        </div>
                    </div>
                }
                else
                {
                    <div class="field">
                        <div class="editor-label">
                            <span>*</span>活动网址：
                        </div>
                        <div class="editor-field-long">
                            @Html.EditorFor(model => model.ShopUrl)
                            @Html.Hidden("Address", "无")
                        </div>
                        <div class="editor-field-validate">
                            @Html.ValidationMessageFor(model => model.ShopUrl)
                        </div>
                    </div>  
                }
                <div class="field">
                    <div class="editor-label">
                        开始日期：
                    </div>
                    <div class="editor-field">
                        @Html.TextBoxFor(model => model.StartDate, new { @class = "Wdate", datatype = "date", onFocus = "WdatePicker({skin: 'whyGreen',isShowWeek:true,minDate:'%y-%M-%d',maxDate:'#F{$dp.$D(\\'EndDate\\')}'})" })
                        @Html.ValidationMessageFor(model => model.StartDate)
                    </div>
                    <div class="editor-label">
                        结束日期：
                    </div>
                    <div class="editor-field">
                        @Html.TextBoxFor(model => model.EndDate, new { @class = "Wdate", datatype = "date", onFocus = "WdatePicker({skin: 'whyGreen',isShowWeek:true,minDate:'#F{$dp.$D(\\'StartDate\\')}',maxDate:''})" })
                        @Html.ValidationMessageFor(model => model.EndDate)
                    </div>
                </div>
                <div class="field">
                    <div class="editor-label">
                        商家名：
                    </div>
                    <div class="editor-field medle">
                        @Html.EditorFor(model => model.BusinessName)
                        @Html.ValidationMessageFor(model => model.BusinessName)
                    </div>
                    <div class="editor-label">
                        联系电话：
                    </div>
                    <div class="editor-field medle">
                        @Html.EditorFor(model => model.Phone)
                        @Html.ValidationMessageFor(model => model.Phone)
                    </div>
                </div>
                <div style="height: auto;" class="field">
                    <div class="editor-label">
                        图片：
                    </div>
                    <div class="editor-field" style="width:auto" >
                        <input type="file" name="ImageName" id="ImageName"/>
                        @Html.ValidationMessageFor(m => m.ImageName)
                    </div>
                    <label>
                        促销活动图片， <span style="color: Red">规格：135px * 90px</span>
                    </label>
                </div>
                <div style="height: auto; margin-top: 10px;" class="field">
                    <div class="editor-label">
                        详细信息：
                    </div>
                    <div class="editor-field-long">
                        @Html.TextAreaFor(m => m.Desception, new
                   {
                       @class = "xheditor {tools:'Blocktag,Fontface,FontSize,|," +
                           "Bold,Italic,Underline,Strikethrough,|,FontColor,BackColor,SelectAll,Removeformat,|," +
                           "Align,List,Outdent,Indent,|,Link,Unlink,Hr,Anchor,Table,|,Img,|,Fullscreen,Preview'," +
                           "skin:'default',width:'100%',height:'200px',cleanPaste:1," +
                           "upLinkUrl:'/Home/XhUpload',upImgUrl:'/Home/XhUpload?immediate=2',upFlashUrl:'XhEditor/XhUpload',upMediaUrl:'XhEditor/XhUpload' }"
                   })
                    </div>
                </div>
                <p>
                    <input type="submit" class="btn_mid" onclick="return valid()" value="发　　布" />
                </p>
            </div>
        </fieldset>
    }
</div>
